<?php
use yii\helpers\Url;
?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>铝邦CRM客户管理系统</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap-datetimepicker.min.css"/>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/setting.css"/>
    <script src="js/jquery-1.12.3.min.js"></script>
    <script src="layui/layui.all.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body class="white">
    <div class="part-top">
        <h3><?=$clueInfo['enterpriseName']?></h3>
        <p>负责客服：<span><?=$clueInfo['users']['userName']?></span></p>
        <p>跟进状态：<span><?=$clueInfo['followStatus']['name']?></span></p>
        <div class="clear"></div>
        <div class="btn-wap">
            <div class="btn-comm" data-toggle="modal" data-target="#toClient">转成企业</div>
            <div class="btn-comm" data-toggle="modal" data-target="#xappointClues">指派</div>
            <div class="btn-comm" data-toggle="modal" data-target="#editClues">编辑</div>
            <div class="btn-comm" data-toggle="modal" data-target="#delClues">删除</div>
        </div>
        <div class="clear"></div>
        <div class="sys-msg sys-on col-sm-1">基本信息</div>
        <div class="log-msg col-sm-1">操作日志</div>
        <div class="clear"></div>
    </div>
    <div class="main-left pull-left">
        <div class="msg-all">
            <h4>基本信息</h4>
            <div class="left-body">
                <label class="label-left-sm">公司名称：</label>
                <span><?=$clueInfo['companyName']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">公司地址：</label>
                <span><?=$clueInfo['companyAddress']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">主营产品：</label>
                <span><?=$clueInfo['mainProduct']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">产品标准：</label>
                <span>
                    <?php if($clueInfo['standardId']==1) {
                    echo '国际';
                    }else if($clueInfo['standardId']==2){
                     echo '普通';
                    }else{
                      echo '国际与普通';
                    }

                   ?>
                </span>
                <div class="clear"></div>
            </div>
        </div>
        <div class="msg-cont">
            <h4>联系信息</h4>
            <div class="left-body">
                <label class="label-left-sm">联系人：</label>
                <span><?=$clueInfo['contactName']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">职务：</label>
                <span><?=$clueInfo['job']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">电话：</label>
                <span><?=$clueInfo['phone']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">手机：</label>
                <span><?=$clueInfo['cellPhone']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">微信：</label>
                <span><?=$clueInfo['weChatId']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">QQ：</label>
                <span><?=$clueInfo['QQ']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">邮箱：</label>
                <span><?=$clueInfo['email']?></span>
                <div class="clear"></div>
            </div>
        </div>
        <div class="msg-other">
            <h4>其他信息</h4>
            <div class="left-body">
                <label class="label-left-sm">负责人：</label>
                <span><?=$clueInfo['users']['userName']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">跟进状态：</label>
                <span><?=$clueInfo['followType']['name']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">配合程度：</label>
                <span><?=$clueInfo['coordinationDegree']['name']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">线索来源：</label>
                <span><?=$clueInfo['clueOrgin']['name']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">创建时间：</label>
                <span><?=$clueInfo['addTime']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">最新跟进时间：</label>
                <span><?=$clueInfo['lastFollowTime']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">下次跟进时间：</label>
                <span><?=$clueInfo['nextFollowTime']?></span>
                <div class="clear"></div>
                <label class="label-left-sm">备注：</label>
                <span><?=$clueInfo['remarks']?></span>
                <div class="clear"></div>
            </div>
        </div>
    </div>
    <div class="main-right pull-left">
        <div class="follow-msg">
            <span>跟进状态</span>
            <div class="follow-btn" data-toggle="modal" data-target="#addFollow">+写跟进</div>
        </div>
        <div class="follow-msg-box">
            <?php foreach($followInfosList as $value){

            ?>
                <div class="follow-msg-wap">
                    <span class="list-boll"></span>
                    <div class="follow-time"><?=date('m-d',$value['addTime'])?></div>
                    <div class="follow-sys">
                        <label>跟进人：</label>
                        <span><?=$value['users']['userName']?></span>
                        <span> > </span>
                        <span><?=$value['followType']['name']?></span>
                        <div class="clear"></div>
                        <span><?=$value['followContent']?></span>
                        <div class="clear"></div>
                        <label for="">配合程度：</label>
                        <span><?=$value['coordinationDegree']['name']?></span>
                        <div class="clear"></div>
                        <label for="">跟进状态：</label>
                        <span><?=$value['followStatus']['name']?></span>
                        <div class="clear"></div>
                        <label for="">跟进时间：</label>
                        <span><?=date('Y-m-d H:i',$value['followTime'])?></span>
                        <div class="clear"></div>
                        <div class="sys-del">删除</div>
                    </div>
                </div>
            <?php
            }
            ?>


        </div>
    </div>
    <div class="modal" id="addFollow" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <form action="http://www.baidu.com" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title add-title">写跟进</h4>
                </div>
                <div class="modal-body">
                        <input type="hidden" id="clueId" value="<?=$clueInfo['id']?>" />
                        <select name="" id="followType" class="modal-select-fo">
                            <?php foreach($followTypeList as $value){

                          ?>
                                <option value="<?=$value['id']?>"><?=$value['name']?></option>
                            <?php
                            }
                            ?>

                        </select>
                        <input id="followTime" class="span2 datetimepicker modal-input-fo" size="16" type="text" value="">
                        <div class="clear"></div>
                        <textarea id="followContent" name="" id="coordinationId" cols="30" rows="10" class="modal-text-fo"></textarea>
                        <div class="clear"></div>
                        <label class="modal-label">配合度：</label>
                        <select name="" id="coordinationId" class="modal-select-sm">
                            <option value="0">--请选择--</option>
                            <?php foreach($coordinationList as $value){

                                ?>
                                <option value="<?=$value['id']?>"><?=$value['name']?></option>
                                <?php
                            }
                            ?>
                        </select>
                        <label class="modal-label">跟进状态：</label>
                        <select name="" id="followStatus" class="modal-select-sm">
                            <option value="0">--请选择--</option>
                            <?php foreach($followStatusList as $value){

                                ?>
                                <option value="<?=$value['id']?>"><?=$value['name']?></option>
                                <?php
                            }
                            ?>
                        </select>
                        <div class="clear"></div>
                        <label class="modal-label">下次跟进时间：</label>
                        <input id="nextFollowTime" class="span2 datetimepicker modal-input-lg" size="16" type="text" value="">
                        <div class="clear"></div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" onclick="commitFollowInfo()">保存</button>
                    <button type="button" class="btn btn-default btn-qx" data-dismiss="modal">取消</button>
                </div>
                </form>
            </div>
        </div>
    </div>
    <!--指派-->
    <div class="modal" id="xappointClues" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title add-title">指派线索</h4>
                </div>
                <div class="modal-body">
                    <form id="assignForm" action="" method="post" >
                        <label class="modal-label">新负责人：</label>
                        <?php echo $this->render('../common/alldepartments',['departmentsList'=>$departmentsList]);?>
                        <input type="hidden" name="clueId" value="<?=$clueInfo['id']?>" >

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary btn-sub"  onclick="assignClue()">保存</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!--删除-->
    <div class="modal" id="delClues" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title add-title">提示</h4>
                </div>
                <div class="modal-body">
                    <p class="modal-p">确定删除所选线索？该操作成功后，将无法恢复！</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary btn-del" onclick="clueDelete()">确定删除</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!--编辑-->
    <div class="modal" id="editClues" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title add-title">编辑线索</h4>
                </div>
                <div class="modal-body">
                    <form id="theForm" action="" method="post">
                        <label class="modal-label"><span class="red">*</span>公司名称：</label>
                        <input type="text" id="companyName" placeholder="" value="<?=$clueInfo['companyName']?>" name="companyName" class="modal-input"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>公司地址：</label>
                        <select name="provinceId" id="provinceId" class="modal-select-sm">
                            <option value="0">--省份--</option>
                            <?php foreach($provinceList as $value){

                                ?>
                                <option value="<?=$value['code']?>" <?php if($clueInfo['provinceId']==$value['code']){echo 'selected="selected"';}?>><?=$value['name']?></option>

                                <?php
                            }
                            ?>


                        </select>
                        <select name="cityId" id="cityId" class="modal-select-sm">
                            <option value="0">--城市--</option>
                            <?php foreach($provinceList as $value){

                                ?>
                                <option value="<?=$value['code']?>" <?php if($clueInfo['cityId']==$value['code']){echo 'selected="selected"';}?>><?=$value['name']?></option>

                                <?php
                            }
                            ?>
                        </select>
                        <input type="hidden" name="clueId" value="<?=$clueInfo['id']?>" >
                        <input id="companyAddress" name="companyAddress" value="<?=$clueInfo['companyAddress']?>" class="modal-input-lg left-input" type="text"/>
                        <div class="clear"></div>
                        <label class="modal-label">公司类型：</label>
                        <input id="companyType" type="text" name="companyType" value="<?=$clueInfo['companyType']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">负责客服：</label>
                        <?php echo $this->render('../common/alldepartments',['departmentsList'=>$departmentsList]); ?>

                        <!--<select name="responUserId" id="responUserId" class="modal-select-sm">
                            <option value="0">--用户--</option>

                        </select>-->
                        <div class="clear"></div>
                        <label class="modal-label">联系人：</label>
                        <input type="text" name="contactName" value="<?=$clueInfo['contactName']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">职务：</label>
                        <input type="text" name="job" value="<?=$clueInfo['job']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">电话：</label>
                        <input type="text" placeholder="电话/手机必填一个" value="<?=$clueInfo['phone']?>" name="phone" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">手机：</label>
                        <input type="text" placeholder="手机可以填写多个，用；隔开"  value="<?=$clueInfo['cellphone']?>" name="cellphone" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">微信号：</label>
                        <input type="text" name="wechatId"  value="<?=$clueInfo['wechatId']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">QQ：</label>
                        <input type="text" name="QQ"  value="<?=$clueInfo['QQ']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">邮箱：</label>
                        <input type="text" name="email"  value="<?=$clueInfo['email']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">主营产品：</label>
                        <input type="text" name="mainProduct"  value="<?=$clueInfo['mainProduct']?>" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">产品标准：</label>
                        <select name="standardId" id="standardId" class="modal-select-sm">
                            <option value="0">--请选择--</option>
                            <?php foreach($standardList as $key=>$value){

                           ?>
                                <option value="<?=$value['id']?>" <?php if($value['id']==$clueInfo['standardId']){echo 'selected="selected"';}?>><?=$value['name']?></option>
                            <?php
                            }
                            ?>

                        </select>
                        <div class="clear"></div>
                        <label class="modal-label">线索来源：</label>
                        <select name="" id="" class="modal-select-sm">
                            <option value="0">--请选择--</option>
                            <?php foreach($clueOrginList as $value){

                                ?>
                                <option value="<?=$value['id']?>" <?php if($value['id']==$clueInfo['clueOrgin']['id']){echo 'selected="selected"';}?>><?=$value['name']?></option>
                                <?php
                            }
                            ?>
                        </select>
                        <div class="clear"></div>
                        <label class="modal-label-bz">备注：</label>
                        <textarea name="remarks" id="remarks" cols="30" rows="10"></textarea>
                        <div class="clear"></div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary btn-sub" onclick="commitClue()">保存</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
    <!--转为企业-->
    <div class="modal" id="toClient" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title add-title">转为企业</h4>
                </div>
                <div class="modal-body">
                    <form action="" method="post">
                        <label class="modal-label"><span class="red">*</span>企业名称：</label>
                        <input type="text" placeholder="" name="clientName" id="clientName" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>企业账号：</label>
                        <input type="text" placeholder="" name="clientId" id="clientId" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>法人：</label>
                        <input type="text" placeholder="" name="legalPerson" id="legalPerson" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>负责人：</label>
                        <input type="text" placeholder="" name="responsePerson" id="responsePerson" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>公司地址：</label>
                        <select name="province" id="province" class="modal-select-sm">
                            <option value="0">--省份--</option>
                            <option value="1">福建</option>
                            <option value="2">广东</option>
                            <option value="3">江西</option>
                        </select>
                        <select name="city" id="city" class="modal-select-sm">
                            <option value="0">--城市--</option>
                            <option value="1">厦门</option>
                            <option value="2">福州</option>
                        </select>
                        <input name="clientAccress" id="clientAccress" class="modal-input-lg left-input" type="text"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>公司类型：</label>
                        <select name="companyType" id="companyType" class="modal-select-sm">
                            <option value="0">--请选择--</option>
                            <option value="1">厂家</option>
                            <option value="2">经销商</option>
                        </select>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>联系人：</label>
                        <input type="text" name="contactPerson" id="contactPerson" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label"><span class="red">*</span>联系电话：</label>
                        <input type="text" placeholder="" name="contactPhone" id="contactPhone" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label-lo"><span class="red">*</span>身份证是否为法人/有无授权：</label>
                        <select name="personImpower" id="personImpower" class="modal-select-sm modal-lo">
                            <option value="0">--请选择--</option>
                            <option value="1">否/无</option>
                            <option value="2">否/有授权</option>
                            <option value="3">有/无</option>
                        </select>
                        <div class="clear"></div>
                        <label class="modal-label-lo"><span class="red">*</span>负责人是否和身份证一致：</label>
                        <select name="tureId" id="tureId" class="modal-select-sm modal-lo">
                            <option value="0">--请选择--</option>
                            <option value="1">是</option>
                            <option value="2">否</option>
                        </select>
                        <div class="clear"></div>
                        <div class="many-wap">
                            <label class="modal-label">下次跟进时间：</label>
                            <input class="span2 datetimepicker modal-input-lg" name="lfollowTime" id="lfollowTime" size="16" type="text" value="">
                            <div class="clear"></div>
                            <label class="modal-label">负责客服：</label>
                            <select name="responService" id="responService" class="modal-select-sm">
                                <option value="0">--部门--</option>
                                <option value="1">财务人员</option>
                                <option value="2">运营人员</option>
                            </select>
                            <select name="serviceUser" id="serviceUser" class="modal-select-sm">
                                <option value="0">--用户--</option>
                                <option value="1">思远</option>
                                <option value="2">小曼</option>
                                <option value="3">阿里</option>
                            </select>
                            <div class="clear"></div>
                            <label class="modal-label">申请时间：</label>
                            <input class="span2 datetimepicker modal-input-lg start" name="applyTime" id="applyTime" size="16" type="text" value="">
                            <div class="clear"></div>
                            <label class="modal-label">通过时间：</label>
                            <input class="span2 datetimepicker modal-input-lg end" name="passTime" id="passTime" size="16" type="text" value="">
                            <div class="clear"></div>
                            <label class="modal-label">推荐人：</label>
                            <input type="text" name="recommendPerson" id="recommendPerson" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">推荐人手机：</label>
                            <input type="text" name="recommendPhone" id="recommendPhone" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">注册资金(万元)：</label>
                            <input type="text" name="registeredCapital" id="registeredCapital" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">电话：</label>
                            <input type="text" name="phone" id="phone" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">传真：</label>
                            <input type="text" name="faxes" id="faxes" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">邮箱：</label>
                            <input type="text" name="email" id="email" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">企业网站：</label>
                            <input type="text" name="clientWeb" id="clientWeb" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">主营产品：</label>
                            <input type="text" name="mainProducts" id="mainProducts" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">产品标准：</label>
                            <input type="text" name="productStandard" id="productStandard" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">产能/库存(吨)：</label>
                            <input type="text" name="capacity" id="capacity" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">月销售量(吨)：</label>
                            <input type="text" name="monthlySales" id="monthlySales" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">加工情况：</label>
                            <input type="text" name="processStatus" id="processStatus" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label">主营地区：</label>
                            <input type="text" name="mainArea" id="mainArea" class="modal-input-lg"/>
                            <div class="clear"></div>
                            <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                            <textarea name="remark" id="remark" cols="30" rows="10"></textarea>
                            <div class="clear"></div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn-default btn many">展开更多信息</button>
                    <button type="button" class="btn btn-primary btn-sub" data-dismiss="modal">保存</button>
                    <button type="button" class="btn btn-default btn-qx" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>
    <script>
        $("#addFollow").modal({
            keyboard:false,
            show:false
        });
        $(".span2").datetimepicker({
            language:'zh-CN',//中文显示日期
            format:'yyyy-mm-dd hh:ii',//显示为年：月：日 时：分
            weekStart:1,//星期一为一周开始
            todayBtn:true,//可以选择当前时间
            autoclose:true,//自动关闭
            todayHighlight:true,//今天高亮
            startView:2,
            forceParse:true,  //输入错误的时间时，会强制解析
            showMeridian:true, //启用子午线视图？不知道什么鬼
            minuteStep:5    //最小分钟数，设置为5
        });
        $("#addFollow").click(function () {
            var date = new Date();
            var y = date.getFullYear();
            var m = date.getMonth()+1;
            var d = date.getDate();
            var h = date.getHours();
            var f = date.getMinutes();
            var time = y+"-"+m+"-"+d+" "+h+":"+f;
            $(".modal-input-fo").val(time);
        })
        function commitFollowInfo(){
            var params={};
            params.type=1;
            params.clueId=$('#clueId').val();
            params.followType=$('#followType').val();
            params.followTime=$('#followTime').val();
            params.followContent=$('#followContent').val();
            params.coordinationId=$('#coordinationId').val();
            params.followStatus=$('#followStatus').val();
            params.nextFollowTime=$('#nextFollowTime').val();
            var url="<?=Url::toRoute(['follow-infos/edit-follow-info'])?>";
            $.post(url,params,function(data){
                var data=JSON.parse(data);
                if(data.errcode==0){
                    layer.msg(data.errmsg);
                    window.location.reload();
                }else{
                    layer.msg(data.errmsg);
                }
            });

        }
        function commitClue(){
            var params=$('#theForm').serialize();
            var url="<?=Url::toRoute(['clue/add-clued'])?>"
            $.post(url,params,function(data){
                var data=JSON.parse(data);
                if(data.errcode==0){
                    layer.msg(data.errmsg);
                    window.location.reload();
                }else{
                    layer.msg(data.errmsg);
                }
            });
        }
        /**
         * 删除联系人
         */
        function clueDelete(){
            var url="<?=Url::toRoute(['clue/delete-clue'])?>";
            var clueId="<?=$clueInfo['id']?>";
            $.post(url,{'clueId':clueId},function(data){
                var data=JSON.parse(data);
                if(data.errcode==0){
                    layer.msg(data.errmsg);
                    window.location.href="<?=Url::toRoute(['clue/index'])?>";
                }else{
                    layer.msg(data.errmsg);
                }
            });
        }
        /**
         * 详情页指派联系人
         */
        function assignClue(){
            var params=$('#assignForm').serialize();

            var url="<?=Url::toRoute(['clue/assign-clue'])?>";
            $.post(url,params,function(data){
                var data=JSON.parse(data);
                if(data.errcode==0){
                    layer.msg(data.errmsg);
                    window.location.reload();
                }else{
                    layer.msg(data.errmsg);
                }
            });
        }


    </script>
</body>
</html>